package com.clqteam.daoimpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.clqteam.dao.DeleteVIPDao;
import com.clqteam.util.JDBCutil;
/**
 * VIP删除功能的dao
 * @author Administrator
 *LXG
 */
public class DeleteVIPDaoImpl implements DeleteVIPDao{
	/**
	 * 通过vip的id删除vip信息
	 * @param vId vip的id
	 * @return boolean
	 */
	@Override
	public boolean deleteVIPByVId(int vId) {
		boolean b=false;
		StringBuffer sql = new StringBuffer();
		sql.append(" DELETE FROM s_vip ");
		sql.append(" WHERE s_vip.vId=?");
		Connection con=JDBCutil.getConnection();
		try {
			PreparedStatement pst=con.prepareStatement(sql.toString());
			pst.setInt(1, vId);
			int i=pst.executeUpdate();
			if(i>0){
				b=true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return b;
	}

}
